<template>
  <div class="detail">
    <div class="detail-head">
      <van-icon name="arrow-left" @click="goBack" /><span>{{
        detailDate.address
      }}</span>
    </div>
    <div class="detail-img">
      <img :src="'http://124.93.196.45:10001/' + detailDate.pic" />
    </div>
    <div class="detail-content">
      <h3>{{ detailDate.description }}</h3>
      <div class="content-price">
        <div class="price-left">
          <h4>{{ detailDate.price }}</h4>
          <p>报价</p>
        </div>
        <div class="price-right">
          <h4>{{ detailDate.areaSize }} ㎡</h4>
          <p>建筑面积</p>
        </div>
      </div>
      <p><van-icon name="phone-circle-o" />{{ detailDate.tel }}</p>
    </div>
  </div>
</template>

<script>
import { getDetailDate } from "@/service/houseService";
import mixin from "@/mixin/flag";
export default {
  mixins: [mixin],
  data() {
    return {
      detailDate: {},
    };
  },
  methods: {
    goBack() {
      this.$router.go(-1);
    },
    async getDetailList() {
      let id = this.$route.query;
      const { data } = await getDetailDate(id);
      if (data.code !== 200) this.$toast(data.msg);
      this.detailDate = data.data;
    },
  },
  created() {
    this.getDetailList();
  },
};
</script>

<style lang="scss" scoped>
.detail {
  .detail-head {
    font-size: 30px;
    display: flex;
    i {
      height: 80px;
      line-height: 80px;
    }
    span {
      font-size: 14px;
      height: 80px;
      line-height: 80px;
      padding-left: 5px;
    }
  }
  .detail-img {
    height: 300px;
    img {
      width: 100%;
      height: 100%;
    }
  }
  .detail-content {
    padding: 10px;
    h3 {
      text-indent: 2em;
      padding-left: 10px;
      padding-right: 10px;
      font-size: 16px;
      line-height: 30px;
    }
    .content-price {
      display: flex;
      padding: 20px;
      padding-right: 30px;
      justify-content: space-between;
      div {
        h4 {
          font-size: 20px;
          color: red;
          margin-bottom: 10px;
          text-align: center;
        }
        p {
          padding: 0;
          font-size: 14px;
          text-align: center;
        }
      }
    }
    p {
      height: 20px;
      line-height: 20px;
      padding-left: 10px;
      font-size: 16px;
      color: #333;
      i {
        font-size: 20px;
        margin-right: 10px;
      }
    }
  }
}
</style>
